package api

import (
	"chat_08_21/api/handler"
	"chat_08_21/api/middleware"
	"github.com/gin-gonic/gin"
)

func LoadRouter(r *gin.Engine) {

	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			//用户注册
			user.POST("register", handler.RegisterUser)
			//用户登录
			user.POST("login", handler.LoginUser)

		}

		auth := api.Group("/auth")
		{
			//验证
			auth.Use(middleware.Auth())

		}

	}

}
